package com.xlx.ui.service.error.errorImpl;


import com.xlx.ui.service.error.BaseErrorInfoInterface;

/**
 * @Description: 错误状态码定义
 * @author: 熊良雪
 * @date: 2021-02-04 10:40
 */
public enum ResponseCodeEnum implements BaseErrorInfoInterface {
    /* 成功状态码 */
    SUCCESS(200, "成功!"),

    /* 请求错误：400-500*/
    BODY_NOT_MATCH(400, "请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH(401, "权限不足!"),
    EMAIL_NOT_CODE(402, "验证码已过期,请重新获取!"),
    EMAIL_NOT_NULL(403, "该邮箱已被注册!"),
    NOT_FOUND(404, "未找到该资源!"),
    EMAIL_NOT(405, "验证码错误!"),
    NAME_PASSWORD_NOT_NULL(405, "用户名或密码错误"),
    NAME_PASSWORD_ERROR(406, "原密码错误"),

    /*参数错误：420-440*/
    PARAMETER_INVALID(420, "无效的参数"),
    REQUEST_TYPE_INVALID(421, "无效的请求类型"),
    USER_NULL(422, "账号不存在或密码错误"),
    USER_DISABLE(423, "账号已被锁定"),
    USER_EXIST(424,"用户已存在"),
    USER_NOT_EXIST(423,"用户不存在"),

    /* 服务器错误：500-600 */
    INTERNAL_SERVER_ERROR(500, "未知异常"),
    NULL_SERVER_ERROR(501, "空指针异常!"),
    SERVER_BUSY(503, "服务器正忙，请稍后再试!"),
    PHOTO_ERROR(504, "上传头像失败!"),

    /*业务错误*/
    ADD_ERROR(601, "添加失败"),
    DELETE_ERROR(602, "删除失败"),
    UPDATE_ERROR(603, "修改失败");
    /**
     * 错误码
     */
    private int resultCode;

    /**
     * 错误描述
     */
    private String resultMsg;

    ResponseCodeEnum(int resultCode, String resultMsg) {
        this.resultCode = resultCode;
        this.resultMsg = resultMsg;
    }

    @Override
    public int getResultCode() {
        return resultCode;
    }

    @Override
    public String getResultMsg() {
        return resultMsg;
    }

}
